<?php
/*===========================================================================
Koneksi, perintah query.....
===========================================================================*/
require_once('Connections/dodol.php'); 
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
	{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;}
}
mysql_select_db($database_dodol, $dodol);


$query_db = sprintf("SELECT DISTINCT kode_matkul FROM matkul_db WHERE ta = %s AND sem = %s", GetSQLValueString($ta, "text"),GetSQLValueString($sem, "text"));
$matkul_db = mysql_query($query_db, $dodol) or die(mysql_error());		//query
$row_db = mysql_fetch_assoc($matkul_db);								//dapetin barisnya
$hitung1 = mysql_num_rows($matkul_db);								//total matkul

?>